import 'package:flutter/material.dart';
import 'package:xindong/common/xindong_sezhi.dart';
import 'package:xindong/models/chat_message/xindong_custom_message.dart';
import 'package:xindong/res/assets_res.dart';
import 'package:xindong/utils/xindong_image_util.dart';

// 搭讪提示
class XinDongLiaoTianDaShanTips extends StatelessWidget {
  final XinDongCustomMessage model;

  const XinDongLiaoTianDaShanTips({Key? key, required this.model}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    RegExp exp = RegExp(r"\[(.*?)\]");
    RegExpMatch? match = exp.firstMatch(model.content.toString());
    final text = match?.group(0) ?? '';
    return Row(
      mainAxisSize: MainAxisSize.min,
      mainAxisAlignment: MainAxisAlignment.center,
      children: [
        Text(
          text,
          style: const TextStyle(fontSize: 12, color: DZColors.contentColor, height: 1.2),
        ),
        ImageUtil.asset(AssetsRes.ICON_HONGBAO, height: 14),
      ],
    );
  }
}
